function getDeals(){
    $.get("http://kassandra614.nog.sgsnet.se:8080/dealfinder/deal/getDeals", function(data){
  /**A FUNCTION THAN GETS THE JSONS , APPENDS THE IMAGES TO THE CAROUSEL , ASSIGNS THEM THE IDS, FOLDS THE ONES
  NOT IN THE SCREEN (INITIALLLY)*/
          var JSONS = new Array();
          JSONS = data.deals;
  				NumberOfImages = JSONS.length;/**Setting the number of images to the actual one */
  				if(Images.length>NumberOfImages)/**A function that prevents the unnecessary stocking of unused images*/
  					{
  						for(j=Images.length;j>=NumberOfImages;j--)
  						{
  							Images[j] = null;/**nullifying the unused images*/
  						}
  					}
  				for(i=0;i<NumberOfImages;i++)
  				{/** Appending the images into the carousel */
  					ImageAsText = "image"+(i+1)+".jpg";/**Taking the images */
  					//var $img = $('<img/>').attr({ src:'http://localhost:8080/dealfinder/deal/displayImage/' + JSONS[i].id });
  					Images[i] = new Image();/**Instantiating the Image objects */
  					Images[i].src = 'http://kassandra614.nog.sgsnet.se:8080/dealfinder/deal/displayImage/' + JSONS[i].id;
  					 /**Assigning the sources*/
  					$("div#carouselContainer").append(Images[i]); /**Appending images to the carousel*/
  				}


  				var GetImages = document.querySelectorAll("div#carouselContainer img");/**NOTE : QUERY SELECTOR USED TO GET AN ARRAY*/
  				for(i=0;i<NumberOfImages;i++)/**Assigning id's to images to query later on*/
  				{
  					IdAsText = "carouselImage"+(i+1);/**Creating the text to query the images */
  					GetImages[i].id = IdAsText;
  					IdAsText= "img#carouselImage"+(i+1);/**Querying the images again*/
  					$(IdAsText).click /**Assigning click listeners to all the images*/
  					(
  						function(event)
  						{
  							var ImageNr = this.id.split("carouselImage");/**Getting the image order number*/
  							ImageNr = parseInt(ImageNr[1]);
  							ImageNr = ImageNr-1;
  							document.getElementById("displayImage").src =  "http://kassandra614.nog.sgsnet.se:8080/dealfinder/deal/displayImage/" + JSONS[ImageNr].id;
  							/**Trsansfering the image from the carousel to the imageDisplay in the Display div*/
  							/**Putting the desired image in the container WARNING: CHECK IF IT WORKS
  							WITH THE SERVER OR A SPECIFIC  ASSIGNMENT IMAGE - IMAGE IS NEEDED*/
  							document.querySelector("#dealName").innerHTML = JSONS[ImageNr].name;
  							document.querySelector("#originalPrice").innerHTML = "Original Price : " + JSONS[ImageNr].originalPrice + " euros";
  							document.querySelector("#dealPrice").innerHTML = "Deal Price : " + JSONS[ImageNr].dealPrice + " euros";
  							document.querySelector("#sellingCompany").innerHTML = "Seller: " + JSONS[ImageNr].companyName;
  							document.querySelector("#startDate").innerHTML = "Start : " + JSONS[ImageNr].startTime;
  							document.querySelector("#endDate").innerHTML = "End : " + JSONS[ImageNr].endTime;
  							document.querySelector("#dealLocation").innerHTML = "Location : " + JSONS[ImageNr].address + " " +JSONS[ImageNr].streetNr + ", " + JSONS[ImageNr].postalCode;
  							document.querySelector("#Description").innerHTML = " <b> Description : </b> " + JSONS[ImageNr].informationText;
  							$("#submitDeal").attr({value: JSONS[ImageNr].id});
  							document.querySelector("#map_canvas").style.visibility = "hidden";
  							document.querySelector("#dealsDisplay").style.visibility = "visible";/**Switching from map to showing deals*/;
  						}
  					);
  					if((i+1)>3)
  					{
  						$(IdAsText).animate /**Pseudo - animation : folding the images not initially in the screen*/
  						(
  							{
  								width: 'toggle'
  							},10
  						);
  					}

  				}
  	return JSONS;
  	}, "jsonp");
}